#pragma once

class AstuffMan;
class Aobj;
class Astuff
{
private:
	friend Aobj;
	AstuffMan * mastuffman;

	int acreate();
	void adestory();
	int ainit();
	void aexit();
	int areset();
	int astart();
	void astop();
	bool isrun();
public:
	Aobj * maobj;
	//Astuff();
	Astuff( Aobj * obj =NULL);
	virtual ~Astuff();

	void setObjName(const TCHAR * s);
	const TCHAR * getObjName();
protected:
	int addInit( Aobj * obj);
	int addCreater( Aobj * obj, int size);

	virtual int createAuto();
	virtual int create();
	virtual void destory();

	virtual int init();
	virtual int initAfter();
	virtual void exit();
	virtual void exitAfter();

	virtual int reset();
	virtual int resetAfter();
	//virtual int onStart();
	virtual int start();
	virtual int startAfter();
	virtual void stop();
	virtual void stopAfter();
	//virtual void onStopped();	// called by this self;
};
